

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <meta name="layout" content="main" />
        <g:set var="entityName" value="${message(code: 'school.label', default: 'School')}" />
        <title><g:message code="default.list.label" args="[entityName]" /></title>
    </head>
    <body>
        <div class="body">
            <h1><g:message code="default.list.label" args="[entityName]" /></h1>
            <g:if test="${flash.message}">
            <div class="message">${flash.message}</div>
            </g:if>
        <div class="nav">
            <span class="menuButton"><a class="home" href="${createLink(uri: '/')}">Home</a></span>
            <span class="menuButton"><g:link class="create" action="create"><g:message code="default.new.label" args="[entityName]" /></g:link></span>
        </div>
            <div class="list">
                <table>
                    <thead>
                        <tr>
                        
                            <g:sortableColumn property="name" title="${message(code: 'school.name.label', default: 'Name')}" />
                        
                            <g:sortableColumn property="person" title="${message(code: 'school.person.label', default: 'Person')}" />
                        
                            <g:sortableColumn property="tel" title="${message(code: 'school.tel.label', default: 'Tel')}" />
                        
                            <g:sortableColumn property="start" title="${message(code: 'school.start.label', default: 'Start')}" />
                        
                            <g:sortableColumn property="end" title="${message(code: 'school.end.label', default: 'End')}" />

                            <g:sortableColumn property="subDomain" title="${message(code: 'school.subDomain.label', default: 'SubDomain')}" />
                        
                            <g:sortableColumn property="enable" title="${message(code: 'school.enable.label', default: 'Enable')}" />

                            <th></th>
                        
                        </tr>
                    </thead>
                    <tbody>
                    <g:each in="${schoolInstanceList}" status="i" var="schoolInstance">
                        <tr class="${schoolInstance.enable?'running':'stop'}${(schoolInstance.end - new Date()) < 30 && schoolInstance.enable?' remind':''}">
                        
                            <td><g:link action="show" id="${schoolInstance.id}">${fieldValue(bean: schoolInstance, field: "name")}</g:link></td>
                        
                            <td>${fieldValue(bean: schoolInstance, field: "person")}</td>
                        
                            <td>${fieldValue(bean: schoolInstance, field: "tel")}</td>
                        
                            <td><g:formatDate date="${schoolInstance.start}" /></td>
                        
                            <td><g:formatDate date="${schoolInstance.end}" /></td>

                            <td><a href="http://${schoolInstance.subDomain}.${org.codehaus.groovy.grails.commons.ConfigurationHolder.config.grails.domain}" 
                                target="_blank">${fieldValue(bean: schoolInstance, field: "subDomain")}</a></td>
                        
                            <td><g:formatBoolean boolean="${schoolInstance.enable}" />
                            <g:link controller="schoolMgr" action="goswitch" id="${schoolInstance.id}">${schoolInstance.enable?"关闭":"开启"}
                            </g:link>
                            </td>

                            <td class="operate">
                            <x:operate width="150">
                            <g:link controller="school" action="edit" id="${schoolInstance.id}">修改</g:link>
                            <g:link controller="schoolMgr" action="init" id="${schoolInstance.id}">初始化用户</g:link>
                            <g:link controller="schoolMgr" action="initBlog" id="${schoolInstance.id}">Blog</g:link>
                            </x:operate>
                            </td>
                        
                        </tr>
                    </g:each>
                    </tbody>
                </table>
            </div>
            <div class="paginateButtons">
                <x:paginate total="${schoolInstanceTotal}" />
            </div>
        </div>
    </body>
</html>
